package core.hmxchen.log.config;

import core.hmxchen.log.enums.Level;
import core.hmxchen.log.enums.Position;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * LogPrintProperties
 *
 * @author  hmxchen
 * @version v1.0.0
 * @date  2021/9/12 19:25
 */
@Data
@Configuration("LogPrintProperties")
@ConfigurationProperties(prefix = "logging.log-setting")
public class LogPrintProperties {

    /**
     * 是否打印controller层日志
     */
    private boolean printRequest = false;
    /**
     * 日志级别
     *DEBUG
     *INFO
     *WARN
     *ERROR
     *@return
     */
    private Level level = Level.DEBUG;
    /**
     * 代码定位支持（是否显示方法所在行数）
     * Position.DISABLED 关闭
     * Position.ENABLED 开启
     * @return
     */
    private Position position = Position.DISABLED;
    /**
     * 请求日志实现类全类名
     */
    private String requestLogImpl = "core.hmxchen.log.formatter.RequestLogPrintFormatter";
    /**
     * 参数日志实现类全类名
     */
    private String paramsLogImpl = "core.hmxchen.log.formatter.DoBeforeLogPrintFormatter";
    /**
     * 结果日志实现类全类名
     */
    private String resultLogImpl = "core.hmxchen.log.formatter.AfterReturningLogPrintFormatter";
    /**
     * 异常日志实现类全类名
     */
    private String throwLogImpl = "core.hmxchen.log.formatter.AfterThrowingLogPrintFormatter";
    /**
     * 环绕日志实现类全类名
     */
    private String aroundLogImpl = "core.hmxchen.log.formatter.AroundLogPrintFormatter";

 }
